﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PInitiatives.Models;
using System.ComponentModel.DataAnnotations;

namespace PInitiatives.ViewModels.VMReviews
{
    public class VMToReview
    {
        public IQueryable<Initiative> ParticipatedInitatives { get; set; }
        public IEnumerable<Initiative> CreatedInitatives { get; set; }
    }

    public class VMInitativeReview
    {
        //public Nullable<int> AuthorId { get; set; }
        //public Nullable<int> InitiativeId { get; set; }
        public VMInitativeReview(int authorRate, int initiativeRate, string descrption)
        {
            this.AuthorRate = authorRate;
            this.InitiativeRate = initiativeRate;
            this.Description = descrption;
        }

        public VMInitativeReview() { }

        [Required]
        [Display(Name = "Ocena autora inicjatywy")]
        public int AuthorRate { get; set; }

        [Required]
        [Display(Name = "Ocena incjatywy")]
        public int InitiativeRate { get; set; }

        [Display(Name = "Opinia")]
        public string Description { get; set; }

        public Initiative Initative { get; set; }
    }

    public class VMUserReview
    {
        public List<VMUserRate> usersRate {get; set;}
    }

    public class VMUserRate
    {
        public int UserId { get; set; }
        public int Rate { get; set; }
        public string Description { get; set; }

        public VMUserRate() { }

        public VMUserRate(int user, int rate)
        {
            this.UserId = user;
            this.Rate = rate;
        }
    }

}